package com.lq.schoolshop.dao;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

/**
 * @Author
 * @Date2021/2/2 10:49
 * @Version V1.0
 * 日志记录
 **/
public interface LogMapper {

    /**
     * 插入信息日志
     * @return
     */
    @Insert("INSERT INTO infolog VALUES(DEFAULT,#{url},#{httpmethod},#{path},#{result},#{spendtime},#{methodcount},NOW())")
    int insertinfolog(@Param("url") String url, @Param("httpmethod") String httpmethod, @Param("path") String path,
                      @Param("result") String result, @Param("spendtime") String spendtime,@Param("methodcount") String methodcount);

    /**
     * 插入错误日志
     * @return
     */
    @Insert("INSERT INTO errorlog VALUES(DEFAULT,#{url},#{path},#{result},#{methodcount},#{errormessage},NOW())")
    int inserterrorlog(@Param("url") String url,@Param("path") String path,@Param("result") String result,@Param("methodcount")
            String methodcount,@Param("errormessage") String errormessage);

}
